#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

typedef pair<int,int> pii;
class Node
{
	public:
	string name;
	int folderCnt,fileCnt;
	Node *brother,*child;
	Node(string s="")
	{
		name=s;
		folderCnt=fileCnt=0;
		brother=child=NULL;
	}
};
class Tree
{
	public:
	Node *root;
	Tree()
	{
		root=new Node;
	}
	int insert(string s,Node *nt)
	{
		nt->fileCnt++;
		Node *pt;
		string fname;
		int si;
		for(si=0;si<s.size();si++) if(s[si]=='\\') break;
		if(si==s.size()) return 0;
		else
		{
			fname=s.substr(0,si);
			s=s.substr(si+1,s.size()-si-1);
			//printf("insert: %s remain: %s\n",fname.c_str(),s.c_str());
		}
		for(pt=nt->child;pt;pt=pt->brother) if(pt->name==fname)
		{
			int under=insert(s,pt);
			nt->folderCnt+=under;
			return under;
		}
		if(!pt)
		{
			pt=new Node(fname);
			pt->brother=nt->child;
			nt->child=pt;
			int under=insert(s,pt);
			nt->folderCnt+=under+1;
			return under+1;
		}
	}
	void insert(string s){insert(s,root);}
	pii query()
	{
		pii res(0,0);
		for(Node *pt=root->child;pt;pt=pt->brother)
		{
			for(Node *nt=pt->child;nt;nt=nt->brother)
			{
				res.first=max(res.first,nt->folderCnt);
				res.second=max(res.second,nt->fileCnt);
			}
		}
		return res;
	}
};
int main()
{
	Tree tre;
	string s;
	while(cin>>s) tre.insert(s);
	pii res=tre.query();
	cout<<res.first<<" "<<res.second<<endl;
	return 0;
}
